package com.jingdianjichi.auth.common.enums;

import lombok.Getter;

/**
 * 用户状态枚举
 *
 * @author Richard
 * @date 2024/2/16 13:41
 */
@Getter
public enum AuthUserStatusEnum {
    OPEN(1,"启用"),

    CLOSE(0,"禁用");

    private int code;

    private String desc;

    AuthUserStatusEnum(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static AuthUserStatusEnum getByCode(int codeVal){
        for (AuthUserStatusEnum authUserStatusEnum : AuthUserStatusEnum.values()){
            if (authUserStatusEnum.code == codeVal){
                return authUserStatusEnum;
            }
        }
        return null;
    }
}
